package com.enjoy.book.biz;

import com.enjoy.book.bean.User;

import com.enjoy.book.dao.UserData;

import java.sql.SQLException;

/**
 * @author 赵洋
 */
public class UserBiz {
    /**
     * 构建UserDao的对象
     */
    UserData userData = new UserData();

    public static void main(String[] args) {
        System.out.println(new UserBiz().getUser("super","123") );
    }
    public User getUser(String name, String pwd){
        User  user = null;
        try {
            user  = userData.getUser(name,pwd);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return user;
    }
    public int modifyPwd(long id,String pwd){
        int count = 0;
        try {
            count = userData.modifyPwd(id,pwd);
        } catch (SQLException throwables) {
            throwables.printStackTrace();
        }
        return count;

    }
}
